const mongoose = require('mongoose')

mongoose.connect('mongodb://localhost/test')

const Schema = mongoose.Schema

const studentSchema = new Schema({
	name:{
		type:String,
		required:true
	},
	age:{
		type:String,
		required:true
	},
	sex:{
		type:Number,
		enum:[0,1],
		default:0
	},
	hobbies:{
		type:String
	}
})

var Student = mongoose.model('Student', studentSchema)

module.exports = Student